<!--
 * @Author: zxc
 * @Date: 2020-08-24 09:07:26
 * @LastEditTime: 2020-09-17 19:49:20
 * @LastEditors: zxc
 * @Description:命名视图
-->
<template>
  <div id="app">
    <!-- <div id="nav">
      <router-link :to="{ name: 'home' }">Home</router-link> |
      <router-link :to="{ name: 'about' }">About</router-link>
    </div>-->
    <!-- <transition-group :name="routerTransition"> -->
    <router-view key="default" />
    <router-view key="email" name="email" />
    <router-view key="tel" name="tel" />
    <!-- <router-view /> -->
    <!-- </transition-group> -->
  </div>
</template>

<script>
export default {
  data () {
    return {
      routerTransition: ''
    }
  },
  watch: {
    $route (to) {
      to.query &&
        to.query.transitionName &&
        (this.routerTransition = to.query.transitionName)
    }
  }
}
</script>

<style lang="less">
html,
body {
  height: 100%;
}
body {
  margin: 0;
}
.router-enter {
  opacity: 0;
}
.router-enter-active {
  transition: opacity 1s ease;
}
.router-enter-to {
  opacity: 1;
}
.router-leave {
  opacity: 1;
}
.router-leave-active {
  transition: opacity 1s ease;
}
.router-leave-to {
  opacity: 0;
}
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  color: #2c3e50;
  height: 100%;
}
#nav {
  padding: 30px;
  a {
    font-weight: bold;
    color: #2c3e50;
    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
